export const OTMixinPager = {
    name: 'OTMixinPager',
    data() {
        return {
            pagination: {
                enabled: true,
                size: "mini",
                currentPage: 1,//当前页
                pageSizes: [],//每页大小选项列表
                pageSize: 50,//每页大小
                layouts: ['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'Sizes', 'FullJump', 'Total'],//每页大小选项列表
                total: 0,//总条数
                pagerCount: 5,//显示页码按钮的数量
                selectRowShow: false,//是否显示已选择项
                htmlValue: undefined,//显示内容
                rowSelection: true,
                showDetails: true,
                selectionRowsLength: 0
            }
        }
    },
    methods: {
        handlePageChange({currentPage, pageSize}) {
            this.pagination.currentPage = currentPage
            this.pagination.pageSize = pageSize
            this.query();
        }, clearSelected(o) {
            if (this.selectBox == 1) {
                this.$table.clearRadioRow()
            } else if (this.selectBox == 2) {
                this.$table.clearCheckboxRow()
            }
            this.pagination.selectionRowsLength = 0;
            this.setToolBtn('batchDelete', 'disabled', true)
            this.$emit('clearSelected', o)
        }
    }
}
